The growing with every passing day of the Internet has made applications and information of network be an indispensable part of daily life. The public IP of the Internet, however, is limited in number and therefore NAT (network address translation) has been developed to accommodate more computer devices to access the Internet. The technique of NAT allows each computer device in a private network to share a public IP in a form of IPv4 or IPv6. By way of a network device equipped with NAT function, computer devices in a private network can access the Internet.
Referring to FIG. 1 there is shown a system diagram of a typical network system. As shown in FIG. 1, the network system comprises a NAT network device 10, at least one intranet device 11, and an internet server 12. The NAT network device 10 has a public IP, such as 140.117.171.181, the server 12 has another public IP and port, such as 160.112.100.131:1000, and the intranet device 11 has a private IP and port, such as 192.168.0.100:5000.
The NAT network device 10 is configured to establish a NAT channel between the intranet device 11 and the server 12, and the NAT channel is allocated with a NAT channel port 101 (e.g., port 1000). The NAT channel port 101 is mapped to the private IP and port of the intranet device 11. Before a registered packet 111 can be sent to the server 12 by the intranet device 11, the registered packet 111 is first transmitted to the NAT channel port 101 of the NAT network device 10. The NAT network device 10 translates the source IP and port (i.e., the private IP and port of the intranet device 11) of the registered packet 111 into the public IP and port of the NAT network device 10 (e.g., translating 192.168.0.100:5000 into 140.117.171.181:1000), and then transmits the registered packet 111 to the server 12 via the NAT channel port 101. Similarly, before a response packet 121 can be sent back to the intranet device 11 by the server 12, the response packet 121 is first transmitted to the NAT channel port 101 of the NAT network device. The NAT network device 10 translates the destination IP and port (i.e., the public IP and port of the NAT network device 10) of the response packet 121 into the private IP and port of the intranet device 11 (e.g., translating 140.117.171.181:1000 into 192.168.0.100:5000), and then transmits the response packet 121 to the intranet device 11. Hence, the network connection and packet transmission between the intranet device 11 and the server 12 are made possible by way of the NAT channel established by the NAT network device 10.
Further, the NAT network device 10 voluntarily detects whether the intranet device 11 continues to send packets via the NAT channel port 101. If no any packet is sent to the server 12 by the intranet device 11 via the NAT channel port 101 after a valid period of the NAT channel elapses, the NAT network device 10 voluntarily shuts down the NAT channel between the intranet device 11 and the server 12, thereby cutting off the network connection therebetween.
There does not exist a fixed nominal value for the valid period of the NAT channel, and therefore, in order to retain the NAT channel service, the intranet device 11 in the art frequently sends a test packet to the server 12 via the NAT channel port 101, for example, the intranet device 11 may send a test packet to the server 12 every 10 sec via the NAT channel port 101. However, this approach not only increases the workload of the server 12, but takes up some portions of the bandwidth of the NAT network device 10 due to frequent transmission of the test packet, which affects the data transmission in practice. It is also an adverse to the operation of the network system in general.